package JAVA基础01.Random语句;

import java.util.Random;
import java.util.Scanner;

public class text {
    public static void main(String[] args) {
        Random r = new Random();
        int number = r.nextInt(101) + 1;
        System.out.println(number);

        while (true) {
            System.out.println("请输入你猜的数字");
            Scanner sc = new Scanner(System.in);
            int c = sc.nextInt();
            if (c < number) {
                System.out.println("你猜小了");
            } else if (c > number) {
                System.out.println("你猜大了");
            } else {
                System.out.println("你猜对了");
            }
        }
    }
}
